home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.9 KB | 231 lines | [TEXT/MPS ] |
- //==============================================================================
- //
- // File: SLTxtRun.idl
- //
- // Contains: Interface for OTextRunReader and OTextRunWriter classes
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //==============================================================================
-
- #ifndef SLTXTRUN_IDL
- #define SLTXTRUN_IDL
-
- #ifndef SLTXTTYP_IDL
- #include "SLTxtTyp.idl"
- #endif
-
- #include <somobj.idl>
- #include <somcls.idl>
-
- //========================================================================================
- // Interfaces defined in this unit
- //========================================================================================
-
- interface FW_OTextRunReader;
- interface FW_OTextRunWriter;
- interface FW_OMemoryRunReader;
- interface FW_OMemoryRunWriter;
-
- //========================================================================================
- // FW_OTextRunReader
- //========================================================================================
-
- interface FW_OTextRunReader : SOMObject
- {
- string GetCurrentRun(out FW_ByteCount length, out FW_Locale locale);
- // Return the address, length, and locale of current text run
-
- boolean NextRun();
- // Advance to the next run
- // Return false if there are no more runs, i.e. current buffer is last run
- // Call GetCurrentRun after calling NextRun to get start and length of new run.
-
- boolean PreviousRun();
- // Backup to the previous run
- // Return false if there are no more runs, i.e. current buffer is first run
- // Call GetCurrentRun after calling PreviousRun to get start and length of new run.
-
- FW_ByteCount GetTotalLength();
- // Return the total number of bytes available for reading.
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = "FW_OTextRunReader__";
-
- releaseorder:
- GetCurrentRun,
- NextRun,
- PreviousRun,
- GetTotalLength;
-
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "";
-
- #ifdef __PRIVATE__
- // private data members here
- #endif
-
- };
- #endif
- };
-
- //========================================================================================
- // FW_OTextRunWriter
- //========================================================================================
-
- interface FW_OTextRunWriter : SOMObject
- {
-
- string GetCurrentRun(out FW_ByteCount length);
- // Get start and length of current buffer.
-
- void FlushRun(in string buffer, in FW_ByteCount bytesToFlush);
- // Flush bytes from the current buffer, possibly a subrange of current buffer
-
- boolean NewRun(in FW_Locale locale);
- // Start a new run, where characters will be from specifed locale.
- // Return false if the data structure cannot accept any more text,
- // or if it cannot accept characters from the specified locale.
- // GetCurrentRun must be called to get the buffer for the new run.
-
- void GetLocale(out FW_Locale locale);
- // Return the current locale, if any.
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = "FW_OTextRunWriter__";
-
- releaseorder:
- GetCurrentRun,
- FlushRun,
- NewRun,
- GetLocale;
-
- majorversion = 1;
- minorversion = 1;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "";
-
- #ifdef __PRIVATE__
- // private data members here
- #endif
-
- };
- #endif
- };
-
- //========================================================================================
- // FW_OMemoryRunReader
- //========================================================================================
-
- interface FW_OMemoryRunReader : FW_OTextRunReader
- {
- FW_OMemoryRunReader Initialize(in string buffer, in FW_ByteCount length);
- FW_OMemoryRunReader InitWithLocale(in string buffer, in FW_ByteCount length, in FW_Locale locale);
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = "FW_OMemoryRunReader__";
-
- override:
- somInit,
- somUninit,
- GetCurrentRun,
- NextRun,
- PreviousRun,
- GetTotalLength;
-
- releaseorder:
- somInit,
- somUninit,
- GetCurrentRun,
- NextRun,
- PreviousRun,
- GetTotalLength,
- Initialize,
- InitWithLocale;
-
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "";
-
- #ifdef __PRIVATE__
- // private data members here
- char* fBuffer;
- FW_ByteCount fLength;
- FW_Locale fLocale;
- #endif
-
- };
- #endif
- };
-
- //========================================================================================
- // FW_OMemoryRunWriter
- //========================================================================================
-
- interface FW_OMemoryRunWriter : FW_OTextRunWriter
- {
- FW_OMemoryRunWriter Initialize(in string buffer, in FW_ByteCount capacity);
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = "FW_OMemoryRunWriter__";
-
- override:
- somInit,
- somUninit,
- GetCurrentRun,
- FlushRun,
- NewRun;
-
- releaseorder:
- somInit,
- somUninit,
- GetCurrentRun,
- FlushRun,
- NewRun,
- Initialize;
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "";
-
- #ifdef __PRIVATE__
- char* fBuffer;
- FW_ByteCount fCapacity;
- #endif
-
- };
- #endif
- };
-
- #endif
-